package com.ruoyi.web.controller.app.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Data
@Valid
@ApiModel(value = "RequestSendBedEntity")
public class RequestSendBedEntity {

    @NotNull(message = "用户ID号不能为空")
    @ApiModelProperty(value = "用户ID号", position = 1, required = true)
    private Long memberId;

    @NotBlank(message = "红包金额不能为空")
    //@Pattern(regexp = "^(([0-1]\\d?\\d?|[0-9]\\d?)(\\.\\d{1,2})?|200)$" ,message = "请提交200已内正确的金额")
    @Pattern(regexp = "^(\\d*)(\\.\\d{1,2})?$", message = "请提交正确金额")
    @Pattern(regexp = "^([1-9]\\d*(\\.\\d*)?)|(0\\.\\d*[1-9]+\\d*)$", message = "请提交大于0的金额")
    @Pattern(regexp = "^(([0-1]\\d?\\d?|[0-9]\\d?)(\\.\\d*)?|200)$", message = "请提交200以内的金额")
    @ApiModelProperty(value = "红包金额", position = 2, required = true)
    private String money;

    @Length(max = 128, message = "备注长度不能超过128个字")
    @ApiModelProperty(value = "备注", position = 3, required = true)
    private String note;

    @NotBlank(message = "支付类型不能为空")
    @Pattern(regexp = "^balance|weChatPay|aliPay|weChatPayApp|weChatPayApplet$", message = "请提交指定付款方式")
    @ApiModelProperty(value = "支付类型 （余额：balance，微信：weChatPay，支付宝：aliPay，微信APP：weChatPayApp ，微信小程序：weChatPayApplet）", position = 4, required = true)
    private String payType;

    @Length(max = 6, min = 6, message = "请输入6位支付密码")
    @ApiModelProperty(value = "支付密码", position = 5, required = false)
    private String payPassword;

    @NotNull(message = "发送个数不能为空")
    @Min(value = 1, message = "请提交大于0的个数")
    @Max(value = 200, message = "请提交200以内的个数")
    //@Pattern(regexp = "^[1-9]\\d*$", message = "请提交大于0的个数")
    //@Pattern(regexp = "^([0-1]\\d?\\d?|[0-9]\\d?)|200$", message = "请提交200以内的个数")
    @ApiModelProperty(value = "发送个数", position = 6, required = true)
    private Integer count;

    @NotNull(message = "类型不能为空")
    @Min(value = 3, message = "请提交正确类型")
    @Max(value = 4, message = "请提交正确类型")
    //@Pattern(regexp = "^[3-4]$", message = "请提交正确类型")
    @ApiModelProperty(value = "类型（3、红包 4、金包）", position = 7, required = true)
    private Integer type;
}
